def sum(x):
    sum1 = 0
    for i in x:
        sum1 += i
    return sum1

# 计算均值函数
def mean(x):
    # 求和 / 数量
    return sum(x) / len(x)
    pass

# 计算平方和
def sums(x):
    sum2 = 0
    for i in x:
        sum2 += (i - mean(x)) ** 2
    return sum2

# 计算方差函数
def var(*args):
    # 平方和 / 数量
    return sums(args) / len(args)
    pass


result = var(1, 3, 5)
print(result)